<?php foreach($comments as $comment): ?>

<div class="comment" id="c<?php echo $comment->id; ?>">
  <?php echo CHtml::link("#{$comment->id}",array('recipe/show','id'=>isset($recipe)?$recipe->id:$comment->recipe->id,'#'=>$comment->id),array(
      'class'=>'cid',
      'title'=>'Permalink to this comment',
  )); ?>
  <div class="author"><?php echo CHtml::encode($comment->author->displayName); ?> says:</div>
  <div class="time">
    <?php if (!Yii::app()->user->isGuest && Yii::app()->user->id==$comment->authorId) : ?>
    <?php echo CHtml::link('Update',array('comment/update','id'=>$comment->id)); ?> |
    <?php echo CHtml::linkButton('Delete', array(
	        'submit'=>array('comment/delete','id'=>$comment->id),
            'confirm'=>"Are you sure to delete comment #{$comment->id}?",
    )); ?> |
    <?php endif; ?> 
    <?php echo date('F j, Y \a\t h:i a',$comment->createTime); ?>
  </div>
  <div class="content"><?php echo CHtml::encode($comment->content); ?></div>
</div><!-- comment -->

<?php endforeach; ?>
